﻿using System;
using System.Windows.Forms;

using YAMM.PlugIn;

namespace YAMM.PlugInManagement.Menu
{
    class ToolStripMenuManager : IToolStripMenuManager
    {
        #region IToolStripMenuManager Members

        public IToolStripMenuCollection Items
        {
            get { return menus; }
        }

        #endregion

        ToolStripMenuCollection menus;

        Form owner;

        internal Form Form
        {
            get
            {
                return owner;
            }
        }

        ToolStripContainer menuContainer;

        internal ToolStripContainer MenuContainer
        {
            get
            {
                return menuContainer;
            }
        }

        public ToolStripMenuManager(Form owner, ToolStripContainer menuContainer)
        {
            if (owner == null)
                throw new ArgumentNullException("owner");
            if (menuContainer == null)
                throw new ArgumentNullException("menuContainer");
            this.owner = owner;
            this.menuContainer = menuContainer;
            this.menus = new ToolStripMenuCollection(this);
        }
        
    }
}
